Conversation
There was a problem hiding this comment.
Pull request overview
This pull request implements a major v2 API migration for the ClawSwap SDK, introducing breaking changes to field names, response structures, and error handling patterns. The core SDK implementation (packages/sdk/src/) has been successfully updated to v2 with comprehensive test coverage. However, the browser example applications (examples/browser/ and examples/browser-wagmi/) have not been updated and still use v1 API field names, making them non-functional. A new browser-wagmi example was added to demonstrate integration with wagmi v2 and ConnectKit.
Changes:
- Core SDK updated to v2 API with new field names (sourceChain/sourceToken vs sourceChainId/sourceTokenAddress, userWallet/recipient vs senderAddress/recipientAddress)
- Response structures changed (estimatedOutput vs destinationAmount, requestId vs orderId, new fee structure)
- Error handling updated with new error types and suggestion fields
- New browser-wagmi example added demonstrating wagmi v2 integration
- Test files updated and passing with v2 API
Reviewed changes
Copilot reviewed 43 out of 46 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/sdk/src/types.ts | Updated to v2 API types with renamed fields and new response structures |
| packages/sdk/src/schemas.ts | Updated validation schemas for v2 field names |
| packages/sdk/src/errors.ts | New error types and v2 error envelope structure |
| packages/sdk/src/client.ts | Client methods updated for v2 API, improved token fetching optimization |
| packages/sdk/src/utils/polling.ts | Updated terminal status check for v2 statuses |
| packages/sdk/src/utils/http.ts | Updated error handling for v2 error envelope |
| packages/sdk/tests/*.test.ts | Comprehensive test updates for v2 API |
| examples/node-cli/ | Successfully updated to v2 API |
| examples/browser/ | NOT updated - still uses v1 API (critical issue) |
| examples/browser-wagmi/ | NOT updated - still uses v1 API (critical issue) |
| pnpm-workspace.yaml | Added browser-wagmi example to workspace |
| README.md | Updated documentation for v2 API |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.